//1.编写一个程序，接受用户输入的一段英文句子，并输出该字符串的所有子串。(指针数组的方式维护)
#include <stdio.h>

char printSubstrings(char *str)
{
    char *start = str;
    char *end = str;
    while (*end != '\0')
    {
        if (*end == ' ')
        {
            for (char *pos = start; pos <= end; pos++)
            {
                printf("%c", *pos);
            }
            printf("\n"); 
            start = end + 1;   
        }
        end++;
    }

    for (char *pos = start; pos <= end; pos++)
    {
        printf("%c", *pos);
    }
    printf("\n");
}

int main()
{
    char *str = "nice to meet you";
    
    printSubstrings(str);

    return 0;
}